/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Sorting;

import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.logging.Logger;

/**
 *
 * @author tejinder
 */
public class ItemSorter {

    private static Logger log = Logger.getLogger(ItemSorter.class.getName());

    public void sort(List list, Comparator comparator){

        if(list == null || list.isEmpty()){
            return;
        }

         if (comparator == null) {
            log.warning("Cannot sort with null comparator");
            return;
        }

         Collections.sort(list, comparator);
    }
}
